from osgeo import gdal
import os

# 对应自己的python包的安装地址
os.environ[
    'PROJ_LIB'] = r'C:\Users\Administrator\AppData\Local\Programs\Python\Python39\Lib\site-packages\pyproj\proj_dir\share\proj'  #

if __name__ == '__main__':
    gdal.Translate('pingyuan.png', 'pingyuan.tif', format="PNG", width=256,
                   height=256, bandList=[1, 2, 3], projWinSRS='EPSG:4326',
                   projWin=[109.885496, 21.221616, 109.887560,21.219680 ])
# projWin=[384148.0444, 2346693.34225, 384723.19579, 2347252.78971]
